<?php
/**
* 程序主入口
* 接收两个参数s(state)/a(action)
*/
define('PATH_ROOT', rtrim(dirname(__FILE__), "/") . "/");

/**
* Initial System Configure
*/
require PATH_ROOT . 'config/SysInitConfig.php';//系统define
require PATH_LIBS . 'basics.php';//__autoload函数
require PATH_ROOT . "config/DBConfig.php";//载入数据库配置
new Configure();//app选择器

$state = HttpParams::get(STATE) ? HttpParams::get(STATE) : DEFAULT_STATE;
$class = Common::getFormatName($state, 'class');
$class .= 'Controller';
//invoke the class
$action = HttpParams::get(ACTION) ? HttpParams::get(ACTION) : DEFAULT_ACTION;
$app = new $class($state, $action);
$app->runCommand();
?>